'''
Author: @zhyy
Date: 2021-01-27 14:23:32
LastEditors: @zhyy
LastEditTime: 2021-02-09 16:20:30
'''
from app.api.admin import admin
from app.middlewares.auth_required import login_required
from app.api.admin.controls import user



# 创建管理员
@admin.route("/register", methods=["POST"])
def register_by_email():
        return user.create_admin()

# 管理员登录
@admin.route("/login", methods=["POST"])
def login_by_phone():
    return user.admin_login()


    

#--------------------------用户信息----------------------------------------

@admin.route("/info",methods=["POST"])
@login_required
def logout():
    return user.logout()
# 注销登录
@admin.route("/logout",methods=["POST"])
@login_required
def get_user_info():
    return user.get_user_info()